import Vue from "vue";
import VueRouter from "vue-router";

import Login from "../pages/login";
import Home from "../pages/home";
import Music from "../pages/home/music";
import Games from "../pages/home/games";
import News from "../pages/home/news";
Vue.use(VueRouter);
export default new VueRouter({
  routes: [
    {
      path: "/home",
      component: Home,
      children: [
        {
          path: "music/:id/:time?",
          component: Music,
          name: "music",
          props: true,
        },
        { path: "games", component: Games, name: "games" ,props(route){
            return {...route.query,...{game1:"原神",game2:"王者荣耀",game3:"山海镜花"}}
        }},
        { path: "news", component: News, name: "news" },
        { path: "", component: Music },
      ],
    },
    { path: "/login", component: Login, name: "login" },
    { path: "/", redirect: "/home" },
  ],
});
